home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Lib / test / tsnd.py < prev    next >
Encoding:
Text File  |  2000-06-23  |  421 b   |  19 lines

  1. # Show off SndPlay (and some resource manager functions).
  2. # Get a list of all 'snd ' resources in the system and play them all.
  3.  
  4. from Res import *
  5. from Snd import *
  6.  
  7. ch = SndNewChannel(0, 0, None)
  8. print "Channel:", ch
  9.  
  10. type = 'snd '
  11.  
  12. for i in range(CountResources(type)):
  13.     r = GetIndResource(type, i+1)
  14.     print r.GetResInfo(), r.size
  15.     if r.GetResInfo()[0] == 1:
  16.         print "Skipping simple beep"
  17.         continue
  18.     ch.SndPlay(r, 0)
  19.